//
//  StyleNextTableViewCell.m
//  OneDay
//
//  Created by lanou3g on 15/10/30.
//  Copyright © 2015年 oneDay. All rights reserved.
//

#import "StyleNextTableViewCell.h"


@implementation StyleNextTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addSubViews];
    }
    return self;
}

- (void)addSubViews
{
    self.stylePhoto = [[UIImageView alloc] initWithFrame:CGRectMake(2, kSpace, kWidth - 4, 200)];
    self.stylePhoto.layer.borderWidth = 0.5;
    self.stylePhoto.layer.cornerRadius = 10;
    self.stylePhoto.layer.masksToBounds = YES;
 
    [self.contentView addSubview:self.stylePhoto];
    
    self.styleTitle = [[UILabel alloc] initWithFrame:CGRectMake(kSpace, self.stylePhoto.bottom + kSpace, kWidth - 2 * kSpace, 50)];
//    self.styleTitle.font = [UIFont systemFontOfSize:20];
    self.styleTitle.layer.borderWidth = 0.5;
    self.styleTitle.layer.cornerRadius = 10;
    self.styleTitle.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.styleTitle];
    
}

- (void)setModel:(StyleNextTableViewModel *)model
{
    if (_model != model) {
        _model = model;
    }
    
    self.styleTitle.text = model.title;
    
    [self.stylePhoto sd_setImageWithURL:[NSURL URLWithString:model.photo] placeholderImage:nil];
    
}











@end
